// Test.QuoteAdapter.CTP.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "udirectory.h"
#include "IQuoteService.h"
//#include "CTPQuoteAdapter.h"
//#include ""
#include "uconsole.h"
#include "ThostFtdcUserApiStruct.h"
#include "ustringutils.h"
USING_LIBSPACE

void run_test();
void OnPricerec(void* sender, CThostFtdcDepthMarketDataField* data)
{

	
	UConsole::Print(UConsole::TEXT_GREEN, UStrConvUtils::ToString(data->AskPrice1) );
	
}
int _tmain(int argc, _TCHAR* argv[])
{
	UDirectory::SetAppDirectory();

	run_test();


	IQuoteService* adp =  CreateInstance(_T("QuoteAdapter.CTP.dll"));
	bool ret = adp->InitializeByXML(_T("QuoteAdapter.CTP.xml"));

	::system("pause");

	IQuoteService::OnCTPQuoteRecieved x(OnPricerec);
	adp->SubscribeQuote_CTP(_T("IF1308"),x);

	::system("pause");


	return 0;
}

